// AUSlotsGameModes.H : Declaration of the CAUSlotsGameModes class

#ifndef __AUSLOTSGAMEMODES_H_
#define __AUSLOTSGAMEMODES_H_

class CAUSlotsMaxGameModeIDAccessor
{
public:
	BYTE m_machId[1];
	BYTE m_MaxGameModeID;

BEGIN_COLUMN_MAP(CAUSlotsMaxGameModeIDAccessor)
	COLUMN_ENTRY(1, m_MaxGameModeID)
END_COLUMN_MAP()

BEGIN_PARAM_MAP(CAUSlotsMaxGameModeIDAccessor)
    COLUMN_ENTRY(1, m_machId)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CAUSlotsMaxGameModeIDAccessor, L" \
	SELECT \
		MAX(gamemodeid) AS MaxGameModeID \
	FROM dbo.AUSlotsGameModes \
	WHERE machId = ?")

	// You may wish to call this function if you are inserting a record and wish to
	// initialize all the fields, if you are not going to explicitly set all of them.
	void ClearRecord()
	{
		memset(this, 0, sizeof(*this));
	}
};

class CAUSlotsMaxGameModeID : public CCommand<CAccessor<CAUSlotsMaxGameModeIDAccessor> >
{
public:
	HRESULT Open( CSession* pSession )
	{
		return CCommand<CAccessor<CAUSlotsMaxGameModeIDAccessor> >::Open(*pSession);
	}
};

class CAUSlotsGameModesAccessor
{
public:
	BYTE m_machId[1];
	BYTE m_gamemodeid;
	TCHAR m_description[65];

BEGIN_COLUMN_MAP(CAUSlotsGameModesAccessor)
	COLUMN_ENTRY(1, m_gamemodeid)
	COLUMN_ENTRY(2, m_description)
END_COLUMN_MAP()

BEGIN_PARAM_MAP(CAUSlotsGameModesAccessor)
    COLUMN_ENTRY(1, m_machId)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CAUSlotsGameModesAccessor, L" \
	SELECT \
		gamemodeid, \
		description  \
		FROM dbo.AUSlotsGameModes \
		WHERE machId = ?")

	// You may wish to call this function if you are inserting a record and wish to
	// initialize all the fields, if you are not going to explicitly set all of them.
	void ClearRecord()
	{
		memset(this, 0, sizeof(*this));
	}
};

class CAUSlotsGameModes : public CCommand<CAccessor<CAUSlotsGameModesAccessor> >
{
public:
	HRESULT Open( CSession* pSession )
	{
		return CCommand<CAccessor<CAUSlotsGameModesAccessor> >::Open(*pSession);
	}
};

#endif // __AUSLOTSGAMEMODES_H_
